home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / strstream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  2.1 KB  |  91 lines  |  [TEXT/MPS ]

  1. /*ident    "@(#)C++env:incl-master/const-headers/strstream.h    1.3" */
  2. /**************************************************************************
  3.                         Copyright (c) 1984 AT&T
  4.                           All Rights Reserved   
  5.  
  6.         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
  7.       
  8.         The copyright notice above does not evidence any        
  9.         actual or intended publication of such source code.
  10.  
  11. *****************************************************************************/
  12. #ifndef __STRSTREAM__
  13. #define __STRSTREAM__
  14.  
  15. #include <iostream.h>
  16. class strstreambuf : public streambuf
  17. {
  18. public: 
  19.             strstreambuf() ;
  20.             strstreambuf(int) ;
  21.             strstreambuf(void* (*a)(long), void (*f)(void*)) ;
  22.             strstreambuf(char* b, int size, char* pstart = 0 ) ;
  23.             strstreambuf(unsigned char* b, int size, unsigned char* pstart = 0 ) ;
  24.     int        pcount();
  25.     void        freeze(int n=1) ;
  26.     char*        str() ;
  27.             ~strstreambuf() ;
  28.  
  29. public: /* virtuals  */
  30.     virtual int    doallocate() ;
  31.     virtual int    overflow(int) ;
  32.     virtual int    underflow() ;
  33.     virtual streambuf*
  34.             setbuf(char*  p, int l) ;
  35.     virtual streampos
  36. #ifdef __ATT2_1
  37.             seekoff(streamoff,ios::seek_dir,int) ;
  38. #else  /*__ATT2_1*/
  39.             seekoff(streamoff,seek_dir,int) ;
  40. #endif /*__ATT2_1*/
  41.  
  42. private:
  43.     void        init(char*,int,char*) ;
  44.  
  45.     void*        (*afct)(long) ;
  46.     void        (*ffct)(void*) ;
  47.     int        ignore_oflow ;
  48.     int        froozen ;
  49.     int        auto_extend ;
  50.  
  51. public:
  52.     } ;
  53.  
  54. class strstreambase : public virtual ios {
  55. public:
  56.     strstreambuf*    rdbuf() ;
  57. protected:    
  58.             strstreambase(char*, int, char*) ;
  59.             strstreambase() ;
  60.             ~strstreambase() ;
  61. private:
  62.     strstreambuf    buf ; 
  63.     } ;
  64.  
  65. class istrstream : public strstreambase, public istream {
  66. public:
  67.             istrstream(char* str);
  68.             istrstream(char* str, int size ) ;
  69.             ~istrstream() ;
  70.     } ;
  71.  
  72. class ostrstream : public strstreambase, public ostream {
  73. public:
  74.             ostrstream(char* str, int size, int=ios::out) ;
  75.             ostrstream() ;
  76.             ~ostrstream() ;
  77.     char*        str() ;
  78.     int        pcount() ;
  79.     } ;
  80.  
  81.  
  82. class strstream : public strstreambase, public iostream {
  83. public:
  84.             strstream() ;
  85.             strstream(char* str, int size, int mode) ;
  86.             ~strstream() ;
  87.     char*        str() ;
  88.     } ;
  89.  
  90. #endif
  91.